import request from '@/utils/request'

// 货品分页查询
export const getGoodsList = (params: any) =>
  request({
    url: '/goods/pageDetail',
    method: 'get',
    params
  })

// 货品详情
export const getGoodsListDetails = (id: any) =>
  request({
    url: `/goods/${id}`,
    method: 'get'
  })

// 删除货品
export const deleteGoods = (params: any) =>
  request({
    url: '/goods',
    method: 'delete',
    params
  })
// 新增货品
export const addGoods = (data: any) =>
  request({
    url: '/goods',
    method: 'post',
    data
  })
// 编辑货品
export const updateGoods = (data: any) =>
  request({
    url: '/goods',
    method: 'put',
    data
  })
// 货品类型分页查询
export const getGoodsType = (params: any) =>
  request({
    url: '/goodsType/page',
    method: 'get',
    params
  })
// 货品详情
export const getGoodsListTypeDetails = (id: any) =>
  request({
    url: `/goodsType/${id}`,
    method: 'get'
  })
// 新增货品类型
export const addGoodsType = (data: any) =>
  request({
    url: '/goodsType',
    method: 'post',
    data
  })
// 编辑货品类型
export const updateGoodsType = (data: any) =>
  request({
    url: '/goodsType',
    method: 'put',
    data
  })
// 删除货品类型
export const deleteGoodsType = (params: any) =>
  request({
    url: '/goodsType',
    method: 'delete',
    params
  })
// 货品类型模糊搜索
export const getGoodsTypeList = (params: any) =>
  request({
    url: '/goodsType/vague',
    method: 'get',
    params
  })
// 货主类型模糊搜索
export const getGoodsOwnerTypeList = (params: any) =>
  request({
    url: '/owner/vague',
    method: 'get',
    params
  })
// 库区查询 --不分页
export const getAllGoodsList = (params: any) =>
  request({
    url: '/goods/list',
    method: 'get',
    params
  })
